package com.qingmi.farmer.data.model;

import android.text.TextUtils;

import com.google.gson.annotations.SerializedName;
import com.wjjun.basemvpvm.utils.TimeUtils;

public class Notice {
    //公告id
    @SerializedName("NoticeId")
    private String noticeId;
    //标题
    @SerializedName("Title")
    private String title;
    //内容
    @SerializedName("Context")
    private String context;
    //发布时间
    @SerializedName("ReleaseAt")
    private long releaseAt;
    //发布人
    @SerializedName("ReleaseName")
    private String releaseName;
    //内容url
    @SerializedName("Url")
    private String url;

    private String releaseTitle;

    public String getNoticeId() {
        return noticeId;
    }

    public void setNoticeId(String noticeId) {
        this.noticeId = noticeId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContext() {
        return context;
    }

    public void setContext(String context) {
        this.context = context;
    }

    public long getReleaseAt() {
        return releaseAt;
    }

    public void setReleaseAt(long releaseAt) {
        this.releaseAt = releaseAt;
    }

    public String getReleaseName() {
        return releaseName;
    }

    public void setReleaseName(String releaseName) {
        this.releaseName = releaseName;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }


    @Override
    public String toString() {
        if (TextUtils.isEmpty(releaseTitle)) {
            releaseTitle = title + " (" + TimeUtils.formatDateBySecond(releaseAt, "yyyy-MM-dd") + ")";
        }
        return releaseTitle;
    }
}
